/**
 * Copyright 2008-2009 HAN.BIFANG
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package han.bifang.business.bashe;

import junit.framework.TestCase;
import v1.log.bifang.han.LogQueryRequestDocument;
import v1.log.bifang.han.RetryRequestDocument;

/**
 * @Author kent
 */
public class BasheClientTest extends TestCase {

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testQuery() {
		try {
			LogQueryRequestDocument doc = LogQueryRequestDocument.Factory.newInstance();
			doc.addNewLogQueryRequest().addNewViewMessageExchangeRequest().setMessageId("402881e5211b2d8601211b371bf70001");
			System.out.println(BasheClient.query(doc, "http://localhost:7001/basheWeb/logQuery_v1", 60));
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void testRetry() {
		try {
			RetryRequestDocument doc = RetryRequestDocument.Factory.newInstance();
			doc.addNewRetryRequest().setMessageLogId("402881e42124daee012124e07e7d0003");
			//doc.addNewLogQueryRequest().addNewViewMessageExchangeRequest().setMessageId("402881e5211b2d8601211b371bf70001");
			System.out.println(BasheClient.retry(doc, "http://localhost:7001/basheWeb/retry_v1", 60));
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
